package com.xxgc.eow.service.impl;

import com.github.pagehelper.PageHelper;
import com.xxgc.eow.entity.Asktype;
import com.xxgc.eow.mapper.AsktypeMapper;
import com.xxgc.eow.service.IAsktypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 要求类型表 服务实现类
 * </p>
 *
 * @author Mr.Abel
 * @since 2023-05-23
 */
@Service
public class AsktypeServiceImpl extends ServiceImpl<AsktypeMapper, Asktype> implements IAsktypeService {

    @Resource
    private AsktypeMapper asktypeMapper;
    @Override
    public int delAsktype(Asktype asktype) {
        return asktypeMapper.deleteByPrimaryKey(asktype);
    }

    @Override
    public List<Asktype> getByKeyWord(int pageNum, int pageSize, String keyWord) {
        PageHelper.startPage(pageNum,pageSize);
        return asktypeMapper.selectAllBykeyWord(keyWord);
    }

    @Override
    public List<Asktype> getAllPage(String keyWord) {
        return asktypeMapper.selectAllBykeyWord(keyWord);
    }
}
